import request from './request';

// 发送验证码
export const sendCode = (phone: string) => {
  return request.get(`/auth/msm/sendmessage?phone=${phone}`);
};
//获取会议室列表
export const getRoomList = (query: any) => {
    return request({
      url: '/kjy/rooms/list',
      method: 'get',
      params: query,
    });
};
//根据id获取会议室
export const getRoomById = (id: number) => {
  return request({
    url: `/kjy/rooms/${id}`,
    method: 'get',
  });
};

//获取我的预约列表
export const getMyReserveList = (query: any) => {
  return request({
    url: '/kjy/roomReservation/list',
    method: 'get',
    params: query,
  });
};

//预约会议室
export const reserveRoom = (data: any) => {
  return request({
    url: '/kjy/roomReservation',
    method: 'post',
    data: data,
  });
};

//修改预约状态
export const updateRoomStatus = (data: any) => {
  return request({
    url: '/kjy/roomReservation',
    method: 'put',
    data: data,
  });
};
